import request from '@/utils/request'

export function giftCardUserOrderDetail(query) {
  return request({
    url: '/giftcard/giftCardUserOrderDetail',
    method: 'get',
    params: {giftCardOrderId:query}
  })
}
export function entityRemove(query) {
  return request({
    url: '/giftcard/entityRemove',
    method: 'get',
    params: {id:query}
  })
}

export function listGiftCard(query) {
  return request({
    url: '/giftcard/list',
    method: 'get',
    params: query
  })
}
// 实物卡统计(总的)
export function statisticTotal(query) {
  return request({
    url: '/giftcard/entityStatisticTotal',
    method: 'get',
    params: query
  })
}
// 实物卡统计(总的)多条数据
export function entityStatisticTotal(query) {
  return request({
    url: '/giftcard/entityTypeStatisticTotal',
    method: 'get',
    params: query
  })
}
// 礼物卡用户记录(单个礼物卡)多条数据
export function typeUserStatistic(query) {
  return request({
    url: '/giftcard/typeUserStatistic',
    method: 'get',
    params: query
  })
}
// 礼物卡明细
export function comsuptionDetails(query) {
  return request({
    url: '/giftcard/comsuptionDetails',
    method: 'get',
    params: query
  })
}
// 虚拟卡统计(总的)
export function VirtualCardStatics(query) {
  return request({
    url: '/giftcard/statisticTotal',
    method: 'get',
    params: query
  })
}
// 虚拟卡多个礼物卡的记录
export function typeStatisticTotal(query) {
  return request({
    url: '/giftcard/queryVirtualGiftCardStatistics',
    method: 'get',
    params: query
  })
}
export function detailGiftCard(id) {
  return request({
    url: '/giftcard/detail',
    method: 'get',
    params: {id}
  })

}
//修改状态
export function updateStatus(id) {
  return request({
    url: '/giftcard/updateStatus',
    method: 'put',
    params:{id}
  })

}

export function updateGiftCard(data) {
  return request({
    url: '/giftcard/update',
    method: 'put',
    data
  })

}

export function deleteGiftCard(id) {
  return request({
    url: '/giftcard/delete',
    method: 'delete',
    params: {id}
  })

}

export function singleEntityTypeStatisticTotal(query) {
  return request({
    url: '/giftcard/singleEntityTypeStatisticTotal',
    method: 'get',
    params: query
  })
}

export function singleStatisticTotal(query) {
  return request({
    url: '/giftcard/singleStatisticTotal',
    method: 'get',
    params: query
  })
}

export function createGiftCard(data) {
  return request({
    url: '/giftcard/create',
    method: 'post',
    data
  })

}



export function getUserListByGiftId(query) {
  return request({
    url: '/giftcarduser/list',
    method: 'get',
    params: query
  })

}


export function bindEntity(data) {
  return request({
    url: '/giftcarduser/bind',
    method: 'post',
    data
  })

}


export function unBindEntity(id) {
  return request({
    url: '/giftcarduser/unbind',
    method: 'put',
    params: {id}
  })

}

export function toggleUserStatus(data) {
  return request({
    url: '/giftcard/toggleUserStatus',
    method: 'put',
    data
  })

}
